translating rectangle using computer graphics